home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 6 / ads / s-unstyp < prev   
Text File  |  1996-02-12  |  7KB  |  194 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                          GNAT RUNTIME COMPONENTS                         --
  4. --                                                                          --
  5. --                S Y S T E M . U N S I G N E D _ T Y P E S                 --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.8 $                              --
  10. --                                                                          --
  11. --   Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc.  --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNAT was originally developed  by the GNAT team at  New York University. --
  32. -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  33. --                                                                          --
  34. ------------------------------------------------------------------------------
  35.  
  36. --  This package contains definitions of standard unsigned types that
  37. --  correspond in size to the standard signed types declared in Standard.
  38. --  and (unlike the types in Interfaces have corresponding names).
  39.  
  40. package System.Unsigned_Types is
  41. pragma Pure (Unsigned_Types);
  42.  
  43.    type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
  44.    type Short_Unsigned       is mod 2 ** Short_Integer'Size;
  45.    type Unsigned             is mod 2 ** Integer'Size;
  46.    type Long_Unsigned        is mod 2 ** Long_Integer'Size;
  47.    type Long_Long_Unsigned   is mod 2 ** Long_Long_Integer'Size;
  48.  
  49.    type Packed_Byte is mod 2 ** 8;
  50.    for Packed_Byte'Size use 8;
  51.    --  Component type for Packed_Butes array
  52.  
  53.    type Packed_Bytes is array (Natural range <>) of Packed_Byte;
  54.    --  This is the type used to implement packed arrays
  55.  
  56.    function Shift_Left
  57.      (Value  : Short_Short_Unsigned;
  58.       Amount : Natural)
  59.      return    Short_Short_Unsigned;
  60.  
  61.    function Shift_Right
  62.      (Value  : Short_Short_Unsigned;
  63.       Amount : Natural)
  64.       return   Short_Short_Unsigned;
  65.  
  66.    function Shift_Right_Arithmetic
  67.      (Value  : Short_Short_Unsigned;
  68.       Amount : Natural)
  69.       return   Short_Short_Unsigned;
  70.  
  71.    function Rotate_Left
  72.      (Value  : Short_Short_Unsigned;
  73.       Amount : Natural)
  74.       return   Short_Short_Unsigned;
  75.  
  76.    function Rotate_Right
  77.      (Value  : Short_Short_Unsigned;
  78.       Amount : Natural)
  79.       return   Short_Short_Unsigned;
  80.  
  81.    function Shift_Left
  82.      (Value  : Short_Unsigned;
  83.       Amount : Natural)
  84.      return    Short_Unsigned;
  85.  
  86.    function Shift_Right
  87.      (Value  : Short_Unsigned;
  88.       Amount : Natural)
  89.       return   Short_Unsigned;
  90.  
  91.    function Shift_Right_Arithmetic
  92.      (Value  : Short_Unsigned;
  93.       Amount : Natural)
  94.       return   Short_Unsigned;
  95.  
  96.    function Rotate_Left
  97.      (Value  : Short_Unsigned;
  98.       Amount : Natural)
  99.       return   Short_Unsigned;
  100.  
  101.    function Rotate_Right
  102.      (Value  : Short_Unsigned;
  103.       Amount : Natural)
  104.       return   Short_Unsigned;
  105.  
  106.    function Shift_Left
  107.      (Value  : Unsigned;
  108.       Amount : Natural)
  109.      return    Unsigned;
  110.  
  111.    function Shift_Right
  112.      (Value  : Unsigned;
  113.       Amount : Natural)
  114.       return   Unsigned;
  115.  
  116.    function Shift_Right_Arithmetic
  117.      (Value  : Unsigned;
  118.       Amount : Natural)
  119.       return   Unsigned;
  120.  
  121.    function Rotate_Left
  122.      (Value  : Unsigned;
  123.       Amount : Natural)
  124.       return   Unsigned;
  125.  
  126.    function Rotate_Right
  127.      (Value  : Unsigned;
  128.       Amount : Natural)
  129.       return   Unsigned;
  130.  
  131.    function Shift_Left
  132.      (Value  : Long_Unsigned;
  133.       Amount : Natural)
  134.      return    Long_Unsigned;
  135.  
  136.    function Shift_Right
  137.      (Value  : Long_Unsigned;
  138.       Amount : Natural)
  139.       return   Long_Unsigned;
  140.  
  141.    function Shift_Right_Arithmetic
  142.      (Value  : Long_Unsigned;
  143.       Amount : Natural)
  144.       return   Long_Unsigned;
  145.  
  146.    function Rotate_Left
  147.      (Value  : Long_Unsigned;
  148.       Amount : Natural)
  149.       return   Long_Unsigned;
  150.  
  151.    function Rotate_Right
  152.      (Value  : Long_Unsigned;
  153.       Amount : Natural)
  154.       return   Long_Unsigned;
  155.  
  156.    function Shift_Left
  157.      (Value  : Long_Long_Unsigned;
  158.       Amount : Natural)
  159.      return    Long_Long_Unsigned;
  160.  
  161.    function Shift_Right
  162.      (Value  : Long_Long_Unsigned;
  163.       Amount : Natural)
  164.       return   Long_Long_Unsigned;
  165.  
  166.    function Shift_Right_Arithmetic
  167.      (Value  : Long_Long_Unsigned;
  168.       Amount : Natural)
  169.       return   Long_Long_Unsigned;
  170.  
  171.    function Rotate_Left
  172.      (Value  : Long_Long_Unsigned;
  173.       Amount : Natural)
  174.       return   Long_Long_Unsigned;
  175.  
  176.    function Rotate_Right
  177.      (Value  : Long_Long_Unsigned;
  178.       Amount : Natural)
  179.       return   Long_Long_Unsigned;
  180.  
  181.    pragma Convention (Intrinsic, Shift_Left);
  182.    pragma Convention (Intrinsic, Shift_Right);
  183.    pragma Convention (Intrinsic, Shift_Right_Arithmetic);
  184.    pragma Convention (Intrinsic, Rotate_Left);
  185.    pragma Convention (Intrinsic, Rotate_Right);
  186.  
  187.    pragma Import (Intrinsic, Shift_Left);
  188.    pragma Import (Intrinsic, Shift_Right);
  189.    pragma Import (Intrinsic, Shift_Right_Arithmetic);
  190.    pragma Import (Intrinsic, Rotate_Left);
  191.    pragma Import (Intrinsic, Rotate_Right);
  192.  
  193. end System.Unsigned_Types;
  194.